#!/usr/bin/python3
# -*- coding: UTF-8 -*-


import os

print(" ===== Python IO ===== ")

#str = input("请输入：")
print ("你输入的内容是: ", str)

source_filename = "test.txt"
fo = open(source_filename, "r+")
print ("文件名: ", fo.name)
print ("是否已关闭 : ", fo.closed)
print ("访问模式 : ", fo.mode)

#fo.write( "www.runoob.com!\nVery good site!\n")

str = fo.read(10)
print ("读取的字符串是 : ", str)


position = fo.tell()
print ("当前文件位置 : ", position)

position = fo.seek(0, 0)
str = fo.read(10)
print( "重新读取字符串 : ", str)


os.rename(source_filename, "new_test.txt")

fo.close()